<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!--_meta 作为公共模版分离出去--><!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta http-equiv="Cache-Control" content="no-siteapp"/>
<link rel="Bookmark" href="/favicon.ico">
<link rel="Shortcut Icon" href="/favicon.ico"/>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui/h-ui/css/H-ui.min.css"/>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui/h-ui.admin/css/H-ui.admin.css"/>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/lib/Hui-iconfont/1.0.8/iconfont.css"/>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui/h-ui.admin/skin/default/skin.css"/>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui/h-ui.admin/css/style.css"/> 

<title>添加模块</title>
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<article class="page-container">
	<input type="hidden" value="${parentCode}" name="parentCode" id="parentCode"/>
	<input type="hidden" value="${module.id}" name="module_id" id="module_id"/>
	<form class="form form-horizontal" id="form-article-add">
		<!-- <div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>模块编号：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="请输入您的模块编号" id="module_id" name="moduleId">
			</div>
		</div> -->
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>模块名称：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${module.name}" placeholder="请输入您的模块名" id="module_name" name="moduleName">
			</div>
		</div>		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>操作地址：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${module.url}" placeholder="请输入您的操作地址" id="module_url" name="moduleUrl">
			</div>
		</div>		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">模块备注：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${module.remake}" placeholder="请输入您的备注信息" id="module_marke" name="moduleMarke">
			</div>
		</div>		

		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button onClick="module_save_submit();" class="btn btn-primary radius" type="button"> 添加</button>
				<button type="reset" class="btn btn-default radius" >&nbsp;&nbsp;重置&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</article>
</body>
<!--_footer 作为公共模版分离出去-->
<script src="${pageContext.request.contextPath}/static/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/h-ui/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/h-ui/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/h-ui/h-ui.admin/js/H-ui.admin.js"></script>
<!--/_footer /作为公共模版分离出去--><!--请在下方写此页面业务相关的脚本-->
<%-- <script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/jquery.validation/1.14.0/messages_zh.js"></script> --%>
<script type="text/javascript">
function module_save_submit(){
	var parentCode = $("#parentCode").val();
	var id =$("#module_id").val();
	var name = $("#module_name").val();
	var url = $("#module_url").val();
	var remake =$("#module_marke").val();

	if($.trim(name)=="" || $.trim(name)==null){
		layer.msg('请输入模块名称!',{icon:5,time:1000});
		return;
	}
	if($.trim(url)=="" || $.trim(url)==null){
		layer.msg('请输入模块链接!',{icon:5,time:1000});
		return;
	}
	var params ={"id":id,"pid":parentCode,"name":name,"url":url,"remake":remake};
	//var params ={"id":id,"name":name,"url":url,"remake":remake};
	 $.ajax({
		url:"${pageContext.request.contextPath}/back/module/moduleSave.htm",
		data:params,
		type:"post",
		dataType:"json",
		success:function(data){
			if(data.code==0){
				layer.msg(data.message,{icon:1,time:1000});
				setTimeout(function () {
					//window.parent.parent.location.href="${pageContext.request.contextPath}/back/permission/admin-permission.htm";
					parent.parent.refreshDtree(parentCode);
					parent.parent.refreshRight(parentCode);
                }, 1500);
			}else{
				layer.msg(data.message,{icon:5,time:1000});
			}
		},
		error:function(data){
			layer.msg(data.message,{icon:5,time:1000});
		}
	}); 
}



 				
</script>
<!--/请在上方写此页面业务相关的脚本-->

</html>